<head>
    <title>后台管理</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <link rel="icon" href="http://www.nldou.com/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="http://www.nldou.com/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="<?php echo $cssroot; ?>jquery-ui.min.css">
    <link rel="stylesheet" href="<?php echo $cssroot; ?>jquery-ui.structure.min.css">
    <link rel="stylesheet" href="<?php echo $cssroot; ?>jquery-ui.theme.min.css">
    <link rel="stylesheet" href="<?php echo $cssroot; ?>main.css">
    <script type="text/javascript" src="<?php echo $jsroot; ?>jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="<?php echo $jsroot; ?>jquery-ui.min.js"></script>
    <script type="text/javascript" src="<?php echo $jsroot; ?>jquery.iframe-transport.js"></script>
    <script type="text/javascript" src="<?php echo $jsroot; ?>jquery.fileupload.js"></script>
    <script type="text/javascript" src="<?php echo $jsroot; ?>ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="<?php echo $jsroot; ?>ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" src="<?php echo $jsroot; ?>ueditor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" charset="utf-8">
        UE.registerUI('dialog', function (editor, uiName) {
            var btn = new UE.ui.Button({
                name   : 'xiumi-connect',
                title  : '秀米',
                onclick: function () {
                    var dialog = new UE.ui.Dialog({
                        iframeUrl: 'http://admin.nldou.com/html/admin/js/ueditor/dialogs/xiumi/xiumi-ue-dialog-v5.html',
                        editor   : editor,
                        name     : 'xiumi-connect',
                        title    : "秀米图文消息助手",
                        cssRules : "width: " + (window.innerWidth - 60) + "px;" + "height: " + (window.innerHeight - 60) + "px;",
                    });
                    dialog.render();
                    dialog.open();
                }
            });
            return btn;
        });
        UE.registerUI('135editor',function(editor,uiName){
            var dialog = new UE.ui.Dialog({
                iframeUrl: 'http://admin.nldou.com/html/admin/js/ueditor/dialogs/135Editor/135EditorDialogPage.html',
                editor:editor,
                name:uiName,
                title:"135编辑器"
            });
            dialog.fullscreen = true;
            dialog.draggable = false;
            var btn = new UE.ui.Button({
                name:'btn-dialog-' + uiName,
                className:'edui-for-135editor',
                title:'135编辑器',
                onclick:function () {
                    dialog.render();
                    dialog.open();
                }
            });
            return btn;
        },undefined);
        // 修改最后的undefined参数为数字序号，比如5，可调整135编辑器按钮的顺序。默认出现在最后面
    </script>

    <script type="text/javascript" src="<?php echo $jsroot; ?>layer.3.0.3/layer/layer.js"></script>
    <?php if (!empty($myjspath)):?>
    <script type="text/javascript" src="<?php echo $jsroot; ?><?php echo $myjspath;?>"></script>
    <?php endif;?>
    <script type="text/javascript">
        $(function () {
            //菜单隐藏
           $(document).on('click','.menutoggle',function () {
               var list = $(this).parent().next('.togglelist');
               if (list.is(':hidden')){
                   $(this).html('隐藏');
                   list.show();
               }else{
                   $(this).html('显示');
                   list.hide();
               }
           });
           //内容隐藏
            $(document).on('click','.txttoggle-icon',function () {
               if ($(this).hasClass('active')){
                   $(this).removeClass('active');
                   $(this).css('transform','rotate(0deg)');
                   $(this).parent().find('.txttoggle-content').addClass('paragraph-cut');
               }else{
                   $(this).addClass('active');
                   $(this).css('transform','rotate(180deg)');
                   $(this).parent().find('.txttoggle-content').removeClass('paragraph-cut');
               }
            });
           //删除确认
            $(document).on('click','.delete-btn',function (e) {
               var res = confirm('确认删除?');
               if(!res) e.preventDefault();
            });
           //表格验证
            $(document).on('submit','form.form-wrap',function () {
                var inputs = $(this).find(':input');
                var ale = false;
                inputs.each(function () {
                    //是否必须
                    var req = parseInt($(this).attr('req'));
                    if (req == 1) {
                        var val = $.trim($(this).val());
                        if (!val){
                            ale = true;
                            return false;
                        }
                    }
                });
                if (ale) {alert('请完善信息');return false;}
                else return true;
            });
            //表单筛选
            $(document).on('click','.filter-btn',function () {
                var form = $(this).parents('form.filter-form-wrap');
                form.submit();
            });
            //表单重置
            $(document).on('click','.reset-btn',function () {
                $(this).parents('form.filter-form-wrap').find('input').val('');
            });
        });
    </script>
</head>